<!--2016-09-30 18:55:57.927-->
<!DOCTYPE html>
<html class="ui-mobile"><head><!-- base href="http://10.62.64.115/portal/templatePage/20150106120255180/login_custom.jsp" -->
    <title>iMC Portal</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
	<link id="pccss" type="text/css" rel="stylesheet" href="iMC%20Portal_files/pagecustom.css">
	<link id="themecss" type="text/css" rel="stylesheet" href="iMC%20Portal_files/jquery.css">
    
    
<script src="iMC%20Portal_files/common.js" type="text/javascript"></script>
<script src="iMC%20Portal_files/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
    		var v_userName;
				var v_pwd;
				var outer_str;
				var inner_str;
				var v_is_selfLogin;	
				var byodserverip;
				var byodserverhttpport;
				var IP_VERSION_V4 = 4;
				var IP_VERSION_V6 = 6;
				var IP_VERSION_UNKNOWN = 0;
				var v_timerIdForGetPwdButton = null;
				var v_getPwdButtonSomething = {};
				var v_sendPwdButtonSomething = {};
				

        var v_custompath = "";
        //ï¿½Ç·ï¿½ï¿½ï¿½Ê¾ï¿½ï¿½ï¿½ï¿½Ò³ï¿½ï¿½Ë®Ó¡ 1ï¿½ï¿½ï¿½ï¿½Ê¾  0ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½
        var uamInitCustom = "1";
        // ï¿½ï¿½ï¿½ï¿½ H3C / HP
        var uamInitLogo = "H3C";
        var customCfg = "";
        var f=false;
        
	    jQuery(document).ready(function() {
	    	f_init();
	    	i_p_f_pageLoading("init");
	    });
	    
	    
	  </script>
    <script language="JavaScript">
	    function f_init() {
	    	var v_userName = $("#id_userName").val();
	    	var v_psd  = $("#id_userPwd").val();
	        v_custompath = f_getPortalCustomPath();
	        if ( null != v_custompath && "" != v_custompath) {
				$("#loginCss").remove();
				$("#commondcCss").remove();
				//$("#id_customPath").val(f_getPortalCustomPathDB());
			}
	    	if (imc_portal_function_ifQuickAuth()) {
		    	$('#id_inputPanel').hide();
		    	$('#phone-login-button-panel').hide();
		    	$('#phone-login-panel').hide();
		    	$('#id_quickAuthPanel').show();
		    	
	    		f_initForQuickAuthPanel();
	    	} else {
		    	$('#id_inputPanel').show();
		    	$('#id_quickAuthPanel').hide();
		    	
	    		f_initForInputPanel();
		    }
	    	
	    	// æ ¹æ®å®¢æ·ç«¯ipæ¯v4è¿æ¯v6æ¥è¯¢å¯¹åºå½¢å¼çBYODæå¡å¨å°å
	    	var ipVersion = imc_portal_function_getClientIPVersion();
	    	if(ipVersion == IP_VERSION_V4){
		    	byodserverip = imc_portal_function_readByodServerAddress();
	    	}else if(ipVersion == IP_VERSION_V6){
	    		byodserverip = "[" + imc_portal_function_readByodServerAddressIPv6() + "]";
	    	}
	    	
	    	byodserverhttpport = imc_portal_function_readByodServerHttpPort();
	    	uamInitCustom = imc_portal_function_uamInitCustom();
	    	uamInitLogo = imc_portal_function_uamInitLogo();
			customCfg = imc_portal_function_getCustomCfg();
			var imc_portal_var_inner_str = imc_portal_function_getStrForInner();
			if (imc_portal_var_inner_str !=null && imc_portal_var_inner_str != "") {
				inner_str = imc_portal_var_inner_str;
			}
			 
			var imc_portal_var_outer_str = imc_portal_function_getStrForOuter();
			if (imc_portal_var_outer_str !=null && imc_portal_var_outer_str != "") {
				 outer_str = imc_portal_var_outer_str;
			}
			
			v_getPwdButtonSomething = {
				v_buttonId : "id_getpwdbutton",
				v_buttonLabel : $("#id_i_p_info_getPwd").val(),
				f_clickFunc : f_showGetUserPwd 
			}
			v_sendPwdButtonSomething = {
				v_buttonId : "id_button_sendDynamicPwd",
				v_buttonLabel : $("#id_i_p_info_clickGetPwd").val(),
				f_clickFunc : f_onSendDynamicPwd 
			}
			
	    	f_initForPublicElement();
	    	f_initForGuestGetPwd();
	    	f_initForGuestGetPwdWithCK();
	    	f_initForSendDynamicPwdWithCK();
	    	f_initForEntranceMode();
	    	f_initForCreatePreGuestMode();
		}

	    function f_initForGuestGetPwd() {
	    	if (document.getElementById("id_getpwdbutton") != null) { // mean the page has "get pwd" function.
				// åªæå¨ä¸æ¯å®å¶é¡µé¢çæåµä¸ï¼æä¼æ¿æ¢é¡µé¢æ¾ç¤ºçæå­
				if ( null == v_custompath || "" == v_custompath ) {
					// ææºå·
		    		$("#id_i_p_name").val($("#id_i_p_info_mbNumber").val()); // change user-name-lable to mobile-name-lable.
		    		$("#id_lable_username").html($("#id_i_p_name").val());
					// è·åå¯ç 
		    		$("#id_getpwdbutton").val($("#id_i_p_info_getPwd").val());
					// 
		    		$("#id_lable_valCode").html($("#id_i_p_info_vCode").val()); 
		    		$("#id_getpwdokbutton").val($("#id_i_p_info_ok").val());
		    		$("#id_getpwdcancelbutton").val($("#id_i_p_info_cancel").val());
		    		$("#id_changeImgLink").html($("#id_i_p_info_valCodeRenew").val());
		    		$("#id_2dCodeTitle").html($("#id_i_p_info_2dCode").val());
				} else {
					if($("#id_lable_username").text()==undefined ||$("#id_lable_username").text()==''){
						$("#id_i_p_name").val($("#id_userName").attr("placeholder"));
					}else{
						$("#id_i_p_name").val($("#id_lable_username").text());
					}
					if(i_p_f_valCodeType()=="0"){
						if($("#id_lable_valCode").text()==undefined || $("#id_lable_valCode").text()==''){
							$("#id_i_p_info_vCode").val($("#id_verifyCode").attr("placeholder"));
						}else{
							$("#id_i_p_info_vCode").val($("#id_lable_valCode").text());
						}
					}else if(i_p_f_valCodeType()=="1"){
						if($("#id_lable_valCode").text()==undefined || $("#id_lable_valCode").text()==''){
						$("#id_i_p_info_vCode").val($("#id_licenseCode").attr("placeholder"));
						}else{
							$("#id_i_p_info_vCode").val($("#id_lable_valCode").text());
						}
					}
					
					if($("#id_lable_userpwd").text()==undefined || $("#id_lable_userpwd").text()==''){
						$("#id_i_p_passwd").val($("#id_userPwd").attr("placeholder"));
					}else{
						$("#id_i_p_passwd").val($("#id_lable_userpwd").text());
					}
				}
		    }
		}
	    
	    function f_initForEntranceMode() {
	    	if ($("#id_entrance").val() == '1' && imc_portal_function_ifShowOnlyPortalAuth()) {
	    		$('#id_onlyPortal').show();
	    		$('#id_des_onlyPortal').show();
	    		$("#id_des_onlyPortal").html($("#id_i_p_portalOnly").val());
		    }
		}
	    
	    function f_initForCreatePreGuestMode() {
	    	if ($("#id_cpgFlag").val() == '1') {
	    		$("#id_2dCodeTitle").html($("#id_text_cpg_tdCode_title").val());
	  	    	$("#id_autoLogin_try").html($("#id_text_cpg_autoLogin_failed").val());
		    }
	    }
	    
	    function f_initForGuestGetPwdWithCK(){
	    	if (document.getElementById("id_getpwdbutton") != null) {
	        	f_setGetUserPassStatusWithCK(true);
	    	}
	    }
	    
	    function f_initForSendDynamicPwdWithCK(){
	    	if (document.getElementById("id_button_sendDynamicPwd") != null) {
	    		f_setSendDynamicPwdStatusWithCK(true);
	    	}
	    }
	    
		function f_initForInputPanel() {
		  var serviceTypeDes;
		  var serviceType;
		  if(imc_portal_function_getCookie("hello2") == "true") {
		      $("#id_isSavePwd").prop("checked", true);
		      $("#id_onlyPortal").prop("checked", imc_portal_function_getCookie("i_p_c_op")=="true");
			  $("#id_userName").val(imc_portal_function_getCookie("hello1"));
		      $("#id_userPwd").val(imc_portal_function_encrypt(imc_portal_function_getCookie("hello3")));
		      serviceType = imc_portal_function_getCookie("hello4");
		      serviceTypeDes = imc_portal_function_getCookie("hello5");
		  } else {
			  $("#id_isSavePwd").prop("checked", false);
			  $("#id_onlyPortal").prop("checked", imc_portal_function_ifOnlyPortalAuth());
		      $("#id_userName").val("");
		      $("#id_userPwd").val("");
		      serviceType = null;
		      serviceTypeDes = null;
		  }
		    
		  var imc_portal_var_service_type_options = imc_portal_function_getServiceTypeOptions();
		  if (imc_portal_var_service_type_options.length > 0) {
	  	    for (i = 0; i < imc_portal_var_service_type_options.length; i++) {
	  	    	if(document.getElementById("id_serviceType") != null ){
			 		  //è¥æ¯éèæå¡ç±»åï¼åä¸éè¦è®¾ç½®ä¸ææ¡åå®¹
					  if(!$("#id_serviceType").is("input")){
	  	    			document.getElementById("id_serviceType").options.add(imc_portal_var_service_type_options[i]);
					  }
	  				}
	        }
	      }

		  if (serviceTypeDes != null) {
			  var v_o = $("#id_serviceType option");
			  var i;
			  for (i=0; i<v_o.length; i++) {
				  if (v_o[i].text == serviceTypeDes) {
					  v_o[i].selected = true;
					  break;
				  }
			  }
		  } else if (serviceType != null) {
		  	if(document.getElementById("id_serviceType") != null ){
			  	$("#id_serviceType").val(serviceType);
				}
		  }

	      /**    */
	      if ( null == v_custompath || "" == v_custompath ) {
		      $("#id_lable_username").html($("#id_i_p_name").val()); 
		      $("#id_lable_userpwd").html($("#id_i_p_passwd").val());
		      $("#id_lable_userDynamicPwd").html($("#id_i_p_dynamicPwd").val());
		      $("#id_button_sendDynamicPwd").val($("#id_i_p_info_clickGetPwd").val());
		      if(document.getElementById("id_serviceType") != null ){
		        $("#id_lable_servicetype").html($("#id_text_servicetype").val());
		   	  }
		      $("#id_des_savepwd").html($("#id_text_isSavepwd").val());
		      $("#id_lable_loginbutton_auth").val($("#id_text_login").val());
		      $("#id_lable_logoutbutton_auth").val($("#id_text_logout").val());
		      $("#id_lable_applyguestbutton").val($("#id_text_request_uam_guest").val());
		      $("#id_lable_login_inside_button_auth").val($("#id_text_login_inside").val());
	          $("#id_lable_login_outside_button_auth").val($("#id_text_login_outside").val());
	      }else{
						if($("#id_lable_username").text()==undefined || $("#id_lable_username").text()==''){
							$("#id_i_p_name").val($("#id_userName").attr("placeholder"));
						}else{
							$("#id_i_p_name").val($("#id_lable_username").text());
						}
						
						
						if(i_p_f_valCodeType()=="0"){
							if($("#id_lable_valCode").text()==undefined || $("#id_lable_valCode").text()==''){
								$("#id_i_p_info_vCode").val($("#id_verifyCode").attr("placeholder"));
							}else{
								$("#id_i_p_info_vCode").val($("#id_lable_valCode").text());
							}
						}else if(i_p_f_valCodeType()=="1"){
							if($("#id_lable_valCode").text()==undefined || $("#id_lable_valCode").text()==''){
							$("#id_i_p_info_vCode").val($("#id_licenseCode").attr("placeholder"));
							}else{
								$("#id_i_p_info_vCode").val($("#id_lable_valCode").text());
							}
						}
						if($("#id_lable_userpwd").text()==undefined ||$("#id_lable_userpwd").text()==''){
							$("#id_i_p_passwd").val($("#id_userPwd").attr("placeholder"));
						}else{
							$("#id_i_p_passwd").val($("#id_lable_userpwd").text());
						}
		  }
	      
	      f_initForUserPwdPanel();
		}
		
		/*  userpwd / dynamicpwd  */
		function f_initForUserPwdPanel() {
			$("#id_userPwdTr").hide();
			$("#id_userDynamicPwdTr").hide();
			var v_pwdMode = $("#id_pwdMode").val();
			if (v_pwdMode == "0" || v_pwdMode == "2") {
				$("#id_userPwdTr").show();
			}
			if (v_pwdMode == "1" || v_pwdMode == "2") {
				$("#id_userDynamicPwdTr").show();
			}
		}

		function f_initForQuickAuthPanel() {
			$("#id_des_quickAuth").html($("#id_text_ClickToServe").val()); 
			$("#id_lable_loginbutton_quickauth").val($("#id_text_login").val());
			$("#id_lable_logoutbutton_quickauth").val($("#id_text_logout").val());
		}
		
		//inside method
		function f_login_inside(){
			var r = f_preLoginForInputPanelInside();
			if (!r) {
				return false;
			}
			$("#id_login_Type").val("1"); 
			v_loginType = "1";
			return f_sendLoginForInner();
	    }
		//outside method
		function f_login_outside(){
			var r = f_preLoginForInputPanelOutside();
			if (!r) {
				return false;
			}
			$("#id_login_Type").val("2"); 
			v_loginType = "2";
			return f_sendLoginForOuter();
	    }

		//check the userName and pwd for Outside
		function f_preLoginForInputPanelOutside() {
			// userName
			var userName=$("#id_userName").val().trim();
			
			// check username
			if(!i_p_f_checkValNotBlank(userName)){
				alert($("#id_i_p_needEnter").val() + $("#id_i_p_name").val());
				return false;
			} else if(userName.indexOf('@') !=-1){
				$("#id_userName_").val(userName.trim());
				v_userName = userName.trim();
			    v_is_selfLogin = 0;
			}else{
				 var re=/^[\s]*$/;
			    if(!outer_str.match(re) && outer_str != "null") {
			    	$("#id_userName_").val(userName.trim() + '@' + outer_str);
					v_userName = userName.trim() + '@' + outer_str;
					v_is_selfLogin = 1;
			    }else{
			    	$("#id_userName_").val(userName.trim());
			    	v_is_selfLogin = 1;
			    }
			}	
            			                                                                                                                                              
			// userPwd
			var userPwd = $("#id_userPwd").val();
			if (!i_p_f_checkValNotNull(userPwd)) {
				alert($("#id_i_p_needEnter").val() + $("#id_i_p_passwd").val().replace(/\s/g,""));
				return false;
			} else {
				$("#id_userPwd_").val(imc_portal_function_base64(userPwd));
				v_psd = userPwd;
			}
			return true;
		}
		
		//check the userName and pwd for Inside
		function f_preLoginForInputPanelInside() {
			// userName
			var userName=$("#id_userName").val();
			
			// check username
			if(!i_p_f_checkValNotBlank(userName)){
				alert($("#id_i_p_needEnter").val() + $("#id_i_p_name").val());
				return false;
			} else if(userName.indexOf('@') !=-1){
				$("#id_userName_").val(userName.trim());
				v_userName = userName.trim();
				 v_is_selfLogin = 0;
			}else {
				var re=/^[\s]*$/;
			    if(!inner_str.match(re)  && inner_str != "null" ) {
			    	$("#id_userName_").val(userName.trim() + '@' + inner_str);
					v_userName = userName.trim() + '@' + inner_str;
					 v_is_selfLogin = 1;
			    }else{
			    	$("#id_userName_").val(userName.trim());
			    	v_is_selfLogin = 1;
			    }
			}
			
			// userPwd
			var userPwd = $("#id_userPwd").val();
			if (!i_p_f_checkValNotNull(userPwd)) {
				alert($("#id_i_p_needEnter").val() + $("#id_i_p_passwd").val().replace(/\s/g,""));
				return false;
			} else {
				$("#id_userPwd_").val(imc_portal_function_base64(userPwd));
				v_psd = userPwd;
			}
			return true;
		}
		
		function f_sendLoginForInner() {
			var data;
			$.ajax({
				url: "/portal/pws?t=li",
				type: "POST",
				cache: false,
				async: true,
				dataType: "text",
				data:$("#form1").serializeArray(),
				beforeSend: function() {
					i_p_f_pageLoading("start");
				},
				success: function(json){
			    	data = json;
			    },
				error: function(x,y,z) {
			    },
				complete: function() {
			    	i_p_f_pageLoading("complete");
					if (data == null) {
						alert($("#id_text_networkerror").val());
						return false;
					} else {
				    	return f_afterRequestLoginForInner(data);
				    }
				}
			}); 
		}
		
		function f_sendLoginForOuter() {
			var data;
			$.ajax({
				url: "/portal/pws?t=li",
				type: "POST",
				cache: false,
				async: true,
				dataType: "text",
				data:$("#form1").serializeArray(),
				beforeSend: function() {
					i_p_f_pageLoading("start");
				},
				success: function(json){
			    	data = json;
			    },
				error: function(x,y,z) {
			    },
				complete: function() {
			    	i_p_f_pageLoading("complete");
					if (data == null) {
						alert($("#id_text_networkerror").val());
						return false;
					} else {
				    	return f_afterRequestLoginForOuter(data);
				    }
				}
			}); 
		}

		function f_initForPublicElement() {
		  $("#id_errorMessage").hide();
		  var v_Language = imc_portal_function_getLanguage();
		  if ( null == v_custompath || "" == v_custompath ) {
    		  $("#id_title").html($("#id_text_Top_Description_title").val());
    	      $("#id_copyright").append($("#id_text_Copyright_"+imc_portal_function_uamInitLogo()).val());
		  }
	      $("#id_faq").prop("href", "/portal/faq/portal_faq(" + v_Language +").html");
	      $("#id_faq").html($("#id_text_faq").val());
	      
	      // åå§åç¬ç«ä¿®æ¹å¯ç é¾æ¥ add by lkf4973
	      $("#id_a_modifypwd").prop("href", "/portal/page/modifyPwdAlone.jsp");
	      $("#id_a_modifypwd").html($("#id_text_modifypwd").val());
	      
	      $("#id_btn_modifypwd").val($("#id_text_modifypwd").val());
	      $("#id_btn_modifypwd").click(function(){window.location.href='/portal/page/modifyPwdAlone.jsp'});

	      if ($("#id_findPwdUrl") != null && $("#id_findPwdUrl").val() != null) {
	    	  $("#id_findpwd").show();
		      $("#id_a_findpwd").prop("href", $("#id_findPwdUrl").val());
		      $("#id_a_findpwd").html($("#id_text_getBackPwd").val());
		  } else {
			  $('#id_findpwd').hide();
		  }

	      if ($("#id_preRegisteGuestUrl") != null && $("#id_preRegisteGuestUrl").val() != null) {
	    	  $("#id_applyguest").show();
		      $("#id_a_applyguest").prop("href", $("#id_preRegisteGuestUrl").val());
		      //å®å¶é¡µé¢é¾æ¥
		      $("#id_a_applyguest_custom").prop("href", $("#id_preRegisteGuestUrl").val()).removeAttr("onclick");
		      $("#id_a_applyguest").html($("#id_text_request_uam_guest").val());
		      $("#id_lable_applyguestbutton").show();
		  } else {
			  $("#id_applyguest").hide();
			  $("#id_lable_applyguestbutton").hide();
			  $("#id_a_applyguest_custom_div").hide();
		  }
		}

		function f_login(){
			if(!imc_portal_function_ifQuickAuth()){
				var r = f_preLoginForInputPanel();
				if (!r) {
					return false;
				}
	    	}

			return f_sendLogin();
	    }

		function f_preLoginForInputPanel() {
			// userName
			var userName = $("#id_userName").val();
			// check username
			if(!i_p_f_checkValNotBlank(userName)){
				alert($("#id_i_p_needEnter").val() + $("#id_i_p_name").val());
				return false;
			} else {
				userName = userName.trim();
				var serviceTypeId = $("#id_serviceType").val();
				var i = userName.indexOf('@');
				if(i<0 && serviceTypeId!=null && serviceTypeId!="") {
					userName = userName + '@' + serviceTypeId;
				}
				$("#id_userName_").val(userName);
			}
			
			// userPwd & dynamicPwd
			var v_pwdMode = $("#id_pwdMode").val();
			if (v_pwdMode == "0" || v_pwdMode == "2") {
				var userPwd = $("#id_userPwd").val();
				if (!i_p_f_checkValNotNull(userPwd)) {
					alert($("#id_i_p_needEnter").val() + $("#id_i_p_passwd").val().replace(/\s/g,""));
					return false;
				} 
				$("#id_userPwd_").val(imc_portal_function_base64(userPwd));
			}
			if (v_pwdMode == "1" || v_pwdMode == "2") {
				var v_userDynamicPwd = $("#id_userDynamicPwd").val();
				if (!i_p_f_checkValNotNull(v_userDynamicPwd)) {
					alert($("#id_i_p_needEnter").val() + $("#id_i_p_dynamicPwd").val().replace(/\s/g,""));
					return false;
				} 
				if (!i_p_f_checkValNotNull($("#id_userDynamicPwdd").val())) {
					alert($("#id_text_needGetDynaPwd").val());
					return false;
				} 
			}
			
			// login verify code
			if ($("#id_ifMustGetPasswordBeforeLogin").val() == "true") {
				if (!i_p_f_checkValNotNull($("#id_loginVerifyCode").val())) {
					alert($("#id_text_needGetUserPassword").val());
					return false;
				}
			}

			return true;
		}

		function f_sendLogin(callback4LoginFailed) {
			var data;
			$.ajax({
				url: "/portal/pws?t=li",
				type: "POST",
				cache: false,
				async: true,
				dataType: "text",
				data:$("#form1").serializeArray(),
				beforeSend: function() {
					i_p_f_pageLoading("start");
				},
				success: function(json){
			    	data = json;
			    },
				error: function(x,y,z) {
			    },
				complete: function() {
			    	i_p_f_pageLoading("complete");
					if (data == null) {
						alert($("#id_text_networkerror").val());
						return false;
					} else {
				    	return f_afterRequestLogin(data,callback4LoginFailed);
				    }
				}
			}); 
		}

		function f_logout(){
			return f_sendLogout();
			
		}
		function f_sendLogout() {
			var data;
			$.ajax({
				url: "/portal/pws?t=lo",
				type: "POST",
				cache: false,
				async: true,
				dataType: "text",
				data:$("#form1").serializeArray(),
				beforeSend: function() {
					i_p_f_pageLoading("start");
				},
				success: function(json){
					data = json;
			    },
				error: function(x,y,z) {
				},
				complete: function() {
					i_p_f_pageLoading("complete");
					if (data == null) {
						alert($("#id_text_networkerror").val());
						return false;
					} else {
						return f_afterRequestLogoff(data);
				    }
				}
			}); 
		}

		function f_afterRequestLogin(data,callback4LoginFailed) {
			var json = eval("("+i_p_f_base64DecodeAndUrlDecode(data)+")");  
	  		var v_errorNumber = json.errorNumber; 
	        if (v_errorNumber != null) {
	  	  	  if (v_errorNumber == '1') {
	  	  		f_saveCookie();
	  	  		if (json.macCheckInfo!=null) alert(json.macCheckInfo);
	  	  	    window.location.replace("/portal/page/afterLogin.jsp?pl=" + json.portalLink + "&custompath=" + v_custompath + "&uamInitCustom=" + uamInitCustom + "&uamInitLogo=" + uamInitLogo +"&customCfg="+customCfg+ "&loginType=3" + "&v_is_selfLogin=0"  + "&byodserverip=" + byodserverip  + "&byodserverhttpport=" + byodserverhttpport );
	    		return true;
	  	  	  } else {
		  	  	var v_errorInfo = json[json.e_d];
	  	  		$("#id_errorMessage").show(); 
	  	  		if (v_errorInfo != null) {
	  		  		$("#id_errorMessage").text(v_errorInfo);
	  		  	} else {
	  		  		$("#id_errorMessage").text("login failed.");
	  			}
	  	  		if (callback4LoginFailed!=null) {
	  	  			return callback4LoginFailed();
	  	  		} else {
		  	  		return false;
	  	  		}
	  	  	  }
	        } else {
	          return false;
	        }
		}
		
		function f_afterRequestLoginForInner(data) {
			var json = eval("("+i_p_f_base64DecodeAndUrlDecode(data)+")");  
	  		var v_errorNumber = json.errorNumber; 
	        if (v_errorNumber != null) {
	  	  	  if (v_errorNumber == '1') {
	  	  		f_saveCookie();
	  	  	    window.location.replace("/portal/page/afterLogin.jsp?pl=" + json.portalLink + "&userName=" +  encodeURIComponent(v_userName) + "&userPwd=" + encodeURIComponent(v_psd) + "&loginType=1"+"&customCfg="+customCfg + "&innerStr=" + inner_str + "&outerStr=" + outer_str + "&v_is_selfLogin=" + v_is_selfLogin  + "&byodserverip=" + byodserverip + "&byodserverhttpport=" + byodserverhttpport );
	    		return true;
	  	  	  } else {
		  	  	var v_errorInfo = json[json.e_d];
	  	  		$("#id_errorMessage").show(); 
	  	  		if (v_errorInfo != null) {
	  		  		$("#id_errorMessage").text(v_errorInfo);
	  		  	} else {
	  		  		$("#id_errorMessage").text("login failed.");
	  			}
	  	  		return false;
	  	  	  }
	        } else {
	          return false;
	        }
		}
		
		function f_afterRequestLoginForOuter(data) {
			var json = eval("("+i_p_f_base64DecodeAndUrlDecode(data)+")");  
	  		var v_errorNumber = json.errorNumber; 
	        if (v_errorNumber != null) {
	  	  	  if (v_errorNumber == '1') {
	  	  		f_saveCookie();
	  	  	    window.location.replace("/portal/page/afterLogin.jsp?pl=" + json.portalLink + "&userName=" +  encodeURIComponent(v_userName) + "&userPwd=" + encodeURIComponent(v_psd) + "&loginType=2" +"&customCfg="+customCfg + "&innerStr=" + inner_str + "&outerStr=" + outer_str + "&v_is_selfLogin=" + v_is_selfLogin + "&byodserverip=" + byodserverip + "&byodserverhttpport=" + byodserverhttpport );
	    		return true;
	  	  	  } else {
		  	  	var v_errorInfo = json[json.e_d];
	  	  		$("#id_errorMessage").show(); 
	  	  		if (v_errorInfo != null) {
	  		  		$("#id_errorMessage").text(v_errorInfo);
	  		  	} else {
	  		  		$("#id_errorMessage").text("login failed.");
	  			}
	  	  		return false;
	  	  	  }
	        } else {
	          return false;
	        }
		}

		function f_afterRequestLogoff(data){
			var json = eval("("+i_p_f_base64DecodeAndUrlDecode(data)+")");  
			var v_errorNumber = json.errorNumber; 
	        if (v_errorNumber != null) {
	  	  	  if (v_errorNumber == '1') {
	  	  		alert($("#id_des_logoutsucc").val());
	  	  		return true;
	  	  	  } else {
		  	  	var v_errorInfo = json[json.e_d];
	  	  		$("#id_errorMessage").show(); 
	  	  		if (v_errorInfo != null) {
	  		  		$("#id_errorMessage").text(v_errorInfo);
	  		  	} else {
	  		  		$("#id_errorMessage").text("logoff failed.");
	  			}
	  	  		return false;
	  	  	  }
	        } else {
	        	alert($("#id_des_logoutfailed").val());
	        	return false;
	        }
		}

	    function f_saveCookie(){
	    	imc_portal_function_setCookie("hello1", $("#id_userName").val());
	    	imc_portal_function_setCookie("hello2", $("#id_isSavePwd").prop("checked"));
	    	if($("#id_isSavePwd").prop("checked") || $("#id_saveCookieFlag").val()=='1') {
	    	    imc_portal_function_setCookie("hello3", imc_portal_function_encrypt($("#id_userPwd").val()));
	    	    imc_portal_function_setCookie("hello4", $("#id_serviceType").val());
	    	    imc_portal_function_setCookie("hello5", $("#id_serviceType").find("option:selected").text());
	    	    imc_portal_function_setCookie("i_p_c_op", $("#id_onlyPortal").prop("checked"));
	    	    if ($("#id_userName_").val()!=null) {
		    	    imc_portal_function_setCookie("i_p_c_un", $("#id_userName_").val());
	    	    }
	    	    if ($("#id_userPwd_IE").val()!=null) {
	    	    	imc_portal_function_setCookie("i_p_c_up_ie", $("#id_userPwd_IE").val());
	    	    }
	    	} else {
	    		i_p_f_removeCookie("hello3");
	    		i_p_f_removeCookie("hello4");	
	    		i_p_f_removeCookie("hello5");
	    		i_p_f_removeCookie("i_p_c_op");
	    		
	    		if ($("#id_saveCookieFlag").val()!='1') {
		    		i_p_f_removeCookie("i_p_c_un");
		    		i_p_f_removeCookie("i_p_c_up_ie");
	    		}
	    	}
	    }


	    // ï¿½ï¿½È¡ï¿½ï¿½Â·ï¿½ï¿½ï¿½ï¿½Ê½Îª templatePage/xxxxxxxxxxxxx/
	    function f_getPortalCustomPath() {
	        var re = new RegExp("\/(templatePage\/[0-9]*\/)",'gi');
	        re.exec(window.location.href);
	        return RegExp.$1;
	    }

	    // ï¿½ï¿½È¡ï¿½ï¿½Â·ï¿½ï¿½ï¿½ï¿½Ê½Îª templatePage/xxxxxxxxxxxxx
	    function f_getPortalCustomPathDB() {
	        var re = new RegExp("\/(templatePage\/[0-9]*)\/",'gi');
	        re.exec(window.location.href);
	       return RegExp.$1;
	    }

	    function f_showGetUserPwd() {
	    	if (i_p_f_valCodeType()=='2') {
	    		f_getUserPwd();
	    	} else {
				if($(".class_valcodeTr").length!=0){
					$(".class_valcodeTr").show();
					$("#id_getpwdbutton").hide();
					f_refreshValCodeTdContent();
				}
	    	}
		}
		

			function f_refreshValCodeTdContentNext(d) {
				var data = d; // get the verify-code img, and so on.
	    		var json = null;
				if (data == null) {
					alert($("#id_text_networkerror").val());
					return false;
				} else {
	    			json = eval("("+i_p_f_base64DecodeAndUrlDecode(data)+")");
	    			if (json == null) {
	    				alert("eval error.");
	    				return false;
	        		} else {
	        			var v_errorNumber = json.errorNumber; 
	        			if (v_errorNumber == null || v_errorNumber != '1') {
	        				alert("pro error.");
	        				return false;
	        	        } 
	            	}
				}
				v_valCodeType = json.codeT; // the value is global, it can be change at once.
				if (v_valCodeType == "0") {
					$("#id_valcodeTr").show();
					$(".class_verifyCodeTd").show();
					$(".class_licenseCodeTd").hide();
					if ( null == v_custompath || "" == v_custompath ) {
							$("#id_i_p_info_vCode").val($("#id_i_p_info_verifyCode").val());
							$("#id_lable_valCode").html($("#id_i_p_info_vCode").val()); 
							$("#id_verifyCode").val("");
					}else{
							$("#id_i_p_info_vCode").val($("#id_i_p_info_verifyCode").val());
							$("#id_lable_valCode").html($("#id_i_p_info_vCode").val()); 
						if($("#id_lable_username").text()==undefined || $("#id_lable_username").text()==''){
							$("#id_i_p_name").val($("#id_userName").attr("placeholder"));
						}else{
							$("#id_i_p_name").val($("#id_lable_username").text());
						}
						
						if($("#id_lable_valCode").text()==undefined || $("#id_lable_valCode").text()==''){
							$("#id_i_p_info_vCode").val($("#id_verifyCode").attr("placeholder"));
						}else{
							$("#id_i_p_info_vCode").val($("#id_lable_valCode").text());
						}
						
						if($("#id_lable_userpwd").text()==undefined||$("#id_lable_userpwd").text()==''){
							$("#id_i_p_passwd").val($("#id_userPwd").attr("placeholder"));
						}else{
							$("#id_i_p_passwd").val($("#id_lable_userpwd").text());
						}
					}
		        	$("#id_valcoded").val(json.coded);
		        	$("#id_valimg").prop("src", json.valImgUrl);
			    } else if (v_valCodeType == "1") {
					$("#id_valcodeTr").show();
			    	$(".class_verifyCodeTd").hide();
					$(".class_licenseCodeTd").show();
				    $("#id_licenseCode").val("");
					if ( null == v_custompath || "" == v_custompath ) {
						$("#id_i_p_info_vCode").val($("#id_i_p_info_valLicCode").val());
						$("#id_lable_valCode").html($("#id_i_p_info_vCode").val()); 
					}else{
						$("#id_i_p_info_vCode").val($("#id_i_p_info_valLicCode").val());
						$("#id_lable_valCode").html($("#id_i_p_info_vCode").val()); 
						if($("#id_lable_username").text()==undefined ||$("#id_lable_username").text()==''){
							$("#id_i_p_name").val($("#id_userName").attr("placeholder"));
						}else{
							$("#id_i_p_name").val($("#id_lable_username").text());
						}
						if($("#id_lable_valCode").text()==undefined || $("#id_lable_valCode").text()==''){
							$("#id_i_p_info_vCode").val($("#id_licenseCode").attr("placeholder"));
						}else{
							$("#id_i_p_info_vCode").val($("#id_lable_valCode").text());
						}
						if($("#id_lable_userpwd").text()==undefined||$("#id_lable_userpwd").text()==''){
							$("#id_i_p_passwd").val($("#id_userPwd").attr("placeholder"));
						}else{
							$("#id_i_p_passwd").val($("#id_lable_userpwd").text());
						}
						
					}
				} else {
					$(".class_verifyCodeTd").hide();
					$(".id_licenseCodeTd").hide();
					
				}
			}

			function f_closeGetUserPwd() {
				if($(".class_valcodeTr").length!=0){
					$(".class_valcodeTr").hide();
					$("#id_getpwdbutton").show();
				}
			}
			
			/** 
			,"id_getpwdbutton",$("#id_i_p_info_getPwd").val(),f_showGetUserPwd
			,"id_button_sendDynamicPwd",$("#id_i_p_info_sendPwd").val(),f_onSendDynamicPwd  
			*/
		    function f_refreshStatusForGetPwdButton(v_isComeFromInit,v_button) {
		    	var v_buttonId = v_button.v_buttonId;
		    	var v_buttonLable = v_button.v_buttonLabel;
		    	var f_clickFunc = v_button.f_clickFunc;

		    	var v_endTime = Number(imc_portal_function_getCookie('i_p_c_endTime'));
				var v_currentTime = new Date().getTime(); 
				if (v_endTime > v_currentTime) {
		    		var v_restWaitingTime = Math.floor((v_endTime-v_currentTime)/1000);
		    		var v_waitMsg = $("#id_i_p_info_waitMsg").val() + " " + v_restWaitingTime + " " + $("#id_i_p_info_waitMsg_unit_min").val();
				    if($("#"+v_buttonId).is("input")){
						$("#"+v_buttonId).val(v_waitMsg); 
						$("#"+v_buttonId).attr("disabled","true"); //æ·»å disabledå±æ§ 
					}else{
						$("#"+v_buttonId+":has(span)>span").text(v_waitMsg); 
						$("#"+v_buttonId).not("#"+v_buttonId+":has(span)").text(v_waitMsg); 
						$("#"+v_buttonId).unbind("click");
					}
				    
				    return true;
		    	} else {
					if (!v_isComeFromInit) { // é¡µé¢åå§åæ¶, å¯è½è¿å¥æ¬å½æ°. ä¸ºäºé¿åå¯è½å­å¨çéå¤è®¾ç½®(æ¯å¦,clickäºä»¶éå¤è®¾ç½®ä¼åºbug),æä»¥è¥æ¯é¡µé¢åå§å,åä¸è¿å¥æ¬ä»£ç å.
			    		// clear the timer.
			    		if(v_timerIdForGetPwdButton!=null){ 
							clearInterval(v_timerIdForGetPwdButton);
							v_timerIdForGetPwdButton = null;
						}
			    		
			    		$("#id_errorMessage").hide();
			            if($("#"+v_buttonId).is("input")){
							$("#"+v_buttonId).removeAttr("disabled"); //ç§»é¤disabledå±æ§ 
							$("#"+v_buttonId).val(v_buttonLable);
						}else{
							$("#"+v_buttonId+":has(span)>span").text(v_buttonLable); 
							$("#"+v_buttonId).not("#"+v_buttonId+":has(span)").text(v_buttonLable); 
							$("#"+v_buttonId).unbind("click");
							$("#"+v_buttonId).click(f_clickFunc);
						}
					}
		    	}
		    }
			
			function f_setGetUserPassStatusWithCK(v_isComeFromInit){
				if (f_refreshStatusForGetPwdButton(v_isComeFromInit,v_getPwdButtonSomething)) {
					v_timerIdForGetPwdButton=setInterval(function(){f_refreshStatusForGetPwdButton(false,v_getPwdButtonSomething);}, 1000);
				}
			}
			
			function f_setSendDynamicPwdStatusWithCK(v_isComeFromInit){
				if (f_refreshStatusForGetPwdButton(v_isComeFromInit,v_sendPwdButtonSomething)) {
					v_timerIdForGetPwdButton=setInterval(function(){f_refreshStatusForGetPwdButton(false,v_sendPwdButtonSomething);}, 1000);
				}
			}

			function f_preGetPwd() {
				// username
				var userName = $("#id_userName").val();
				if(!i_p_f_checkValNotBlank(userName)){
					alert($("#id_i_p_needEnter").val() + $("#id_i_p_name").val());
					return false;
				} else if (!i_p_f_checkUserNameValidity(userName)) {
					alert($("#id_i_p_name").val() + $("#id_i_p_namelimit").val());
					return false;
				}
				$("#id_userName_").val(userName);

				// code
				if (i_p_f_valCodeType()!='2') {
					var code = null;
					if (i_p_f_valCodeType() == "0") {
						code = $("#id_verifyCode").val();
				    } else {
				    	code = $("#id_licenseCode").val();
					}
					if(!i_p_f_checkValNotBlank(code)){
						alert($("#id_i_p_needEnter").val() + $("#id_i_p_info_vCode").val());
						return false;
					}
					$("#id_valcode").val(code);
				}
				
				return true;
			}
			
			function f_getUserPwd() {
				var r = f_preGetPwd();
				if (!r) {
					return false;
				}
				var uri = "/portal/pws?t=gp";
				var userGroupId =$("#userGroupId").val();
	            uri += "&userGroupId=" + userGroupId;
	            var regCodeType =$("#regCodeType").val();
	            uri += "&regCodeType=" + regCodeType;
	            var regCode  =$("#regCode").val();
	            uri += "&regCode=" + regCode;
	            var guestManagerId = $("#guestManagerId").val();
                uri += "&guestManagerId=" + guestManagerId;
				var data;
				$.ajax({
					url: uri,
					type: "POST",
					cache: false,
					async: true,
					dataType: "text",
					data:$("#form1").serializeArray(),
					beforeSend: function() {
						i_p_f_pageLoading("start");
					},
					success: function(json){
				    	data = json;
				    },
					error: function(x,y,z) {
				    },
					complete: function() {
				    	i_p_f_pageLoading("complete");
				    	$("#id_userPwd").val(""); // clean pwd
						if (data == null) {
							alert($("#id_text_networkerror").val());
							return false;
						} else {
							var json = eval("("+i_p_f_base64DecodeAndUrlDecode(data)+")");  
							f_refresh2DCode(json.tdCodeImgUrl);
							var v_errorNumber = json.errorNumber; 
					        if (v_errorNumber != null && v_errorNumber == '1') {
							    $("#id_errorMessage").show(); 
							    $("#id_errorMessage").text($("#id_i_p_info_getPwdSuccInfo").val());
							    $("#id_loginVerifyCode").val(json.loginVerifyCode);
					        	f_closeGetUserPwd();
					        	imc_portal_function_setCookie('i_p_c_endTime', new Date().getTime() + ($("#id_intervalTime").val())*1000);
					        	f_setGetUserPassStatusWithCK(false);
					  	  	    return true;
					        } else {
					        	var v_errorInfo;
					        	var v_errorCode = json[json.e_c];
					        	var v_errorDescription = json[json.e_d];
					        	if (v_errorCode!=null && v_errorDescription!=null) {
						        	v_errorInfo = $("#id_text_errormessage").val() + "(" + v_errorCode + ": " + v_errorDescription + ")";
					        	} else if (v_errorDescription!=null) {
					        		v_errorInfo = v_errorDescription;
					        	} else {
					        		v_errorInfo = $("#id_text_errormessage").val();
					        	}
						  		alert(v_errorInfo);
					        	
					        	f_refreshValCodeTdContent();
					        	return false;
					        }
					    }
					}
				}); 
			}
			
			
			function f_refresh2DCode(tdCodeImgUrl) {
				if (tdCodeImgUrl!=null && tdCodeImgUrl!='') {
					$("#id_2dCodeImgTr").show();
					$("#id_2dCodeImg").prop("src", tdCodeImgUrl);
				} else {
					$("#id_2dCodeImgTr").hide();
					$("#id_2dCodeImg").prop("src", "");
				}
			}

		    function f_refreshValCodeTdContent() {
		    	var data = null;
		    	var uri = "/portal/pws?t=gvi";
                var regCodeType =$("#regCodeType").val();
                uri += "&regCodeType=" + regCodeType;
				$.ajax({
					url: uri,
					type: "POST",
					cache: false,
					async: true,
					dataType: "text",
					beforeSend: function() {
						i_p_f_pageLoading("start");
					},
					success: function(json){
						data = json;
				    },
					error: function(x,y,z) {
					},
					complete: function() {
						i_p_f_pageLoading("complete");
						if (data == null) {
							alert($("#id_text_networkerror").val());
							return false;
						} else {
							return f_refreshValCodeTdContentNext(data);
					    }
					}
				});
			}
		    
			function regAndLogin(){
				var uri = "/portal/pws?t=cpg";
				var userGroupId = $("#userGroupId").val();
				var guestManagerId = $("#guestManagerId").val();
				if(userGroupId){
					uri += "&userGroupId=" + userGroupId;
				}
				if(guestManagerId){
					uri += "&guestManagerId="+guestManagerId;
				}
				var data;
				$.ajax({
					url: uri,
					type: "POST",
					cache: false,
					async: true,
					dataType: "text",
					beforeSend: function() {
						i_p_f_pageLoading("start");
					},
					success: function(json){
				    	data = json;
				    },
					error: function(x,y,z) {
				    },
					complete: function() {
				    	i_p_f_pageLoading("complete");
						if (data==null || data=='') {
							alert($("#id_text_networkerror").val());
							return false;
						} else {
							var json = eval("("+i_p_f_base64DecodeAndUrlDecode(data)+")");  
							var v_errorNumber = json.errorNumber; 
					        if (v_errorNumber != null && v_errorNumber == '1') {
					        	if (json.up!=null && json.un!=null) {
					        		$("#id_userName_").val(json.un);
					        	    $("#id_userPwd_IE").val(json.up);
					        		return f_sendLogin();
					        	} else if(json.autoRegAndLoginMsg!=null){
					        		alert(json.autoRegAndLoginMsg);
						        	return false;
					        	}
					        } else {
					        	var v_errorInfo = json.errorMsg+"(error code: "+json.errorCode+")";
				  		  		alert(v_errorInfo);
					        	return false;
					        }
					    }
					}
				});
			}
		    
		    
function f_qPortal() {
	var v_userName = imc_portal_function_getCookie("i_p_c_un");
	var v_pwd = imc_portal_function_getCookie("i_p_c_up_ie");
	var v_regUrlImg = imc_portal_function_getCookie("i_p_c_regUrlImg");
	if ($("#id_cpgFlag").val()=='1' && v_userName!=null && v_userName!='' && v_pwd!=null && v_pwd!='') {
		$("#id_userName_").val(v_userName);
	    $("#id_userPwd_IE").val(v_pwd);
	    return f_sendLogin(f_reqPreGuest);
	} else if (v_userName!=null && v_userName!='' && v_regUrlImg!=null && v_regUrlImg!='') {
		$("#id_userName").val(v_userName);
		f_refresh2DCode(v_regUrlImg);
		f_cpgAutoLogin();
		return true;
	} else {
		return f_reqPreGuest();
	}
}

function f_reqPreGuest() {
	i_p_f_removeCookie("i_p_c_un");
	i_p_f_removeCookie("i_p_c_up_ie");
	i_p_f_removeCookie("i_p_c_regUrlImg");
	var uri = "/portal/pws?t=cpg";
	var userGroupId = $("#userGroupId").val();
	var guestManagerId = $("#guestManagerId").val();
	if(userGroupId){
		uri += "&userGroupId=" + userGroupId;
	}
	if(guestManagerId){
		uri += "&guestManagerId="+guestManagerId;
	}
	var data;
	$.ajax({
		url: uri,
		type: "POST",
		cache: false,
		async: true,
		dataType: "text",
		beforeSend: function() {
			i_p_f_pageLoading("start");
		},
		success: function(json){
	    	data = json;
	    },
		error: function(x,y,z) {
	    },
		complete: function() {
	    	i_p_f_pageLoading("complete");
			if (data==null || data=='') {
				alert($("#id_text_networkerror").val());
				return false;
			} else {
				var json = eval("("+i_p_f_base64DecodeAndUrlDecode(data)+")");  
				var v_errorNumber = json.errorNumber; 
		        if (v_errorNumber != null && v_errorNumber == '1') {
		        	if (json.up!=null && json.un!=null) {
		        		$("#id_userName_").val(json.un);
		        	    $("#id_userPwd_IE").val(json.up);
		        		return f_sendLogin();
		        	} else if (json.un!=null && json.regUrlImg!=null) {
		        		i_p_f_setCookie("i_p_c_un", json.un, 5*60); // 5 minutes
		        		i_p_f_setCookie("i_p_c_regUrlImg", json.regUrlImg, 5*60); // 5 minutes
		        		$("#id_userName").val(json.un);
						f_refresh2DCode(json.regUrlImg);
						f_cpgAutoLogin();
						return true;
		        	}
		        } else {
		        	var v_errorInfo = json.errorMsg+"(error code: "+json.errorCode+")";
	  		  		alert(v_errorInfo);
		        	return false;
		        }
		    }
		}
	});
}

function f_cpgAutoLogin() {
	window.frames['iframe_getLoginInfo'].location.replace("/portal/page/getLoginInfo.jsp?un=" + encodeURIComponent($("#id_userName").val()));
	$("#id_autoLoginErrorPanel").hide();
	return false;
}

function f_shortLogin() {
	var userName = i_p_f_getParameter("un");
	var pwd = i_p_f_getParameter("up");
	var userId = i_p_f_getParameter("uid");
	if (pwd==null || (userName==null && userId==null)) {
		alert("parameters error.");
		return false;
	}
	if (userName!=null) {
		userName = decodeURIComponent(userName);
	}
	if (pwd!=null) {
		pwd = decodeURIComponent(pwd);
	}
	$("#id_userName_").val(userName);
    $("#id_userPwd_IE").val(pwd);
    $("#id_userId").val(userId);
	return f_sendLogin();
}

function f_regPreGuest() {
	
}

function f_checkForRegPreguest() {
	
}

function f_applyGuest() {
	window.location.replace($("#id_preRegisteGuestUrl").val());
}

function f_onSendDynamicPwd() {
	// username
	var userName = $("#id_userName").val();
	if(!i_p_f_checkValNotBlank(userName)){
		alert($("#id_i_p_needEnter").val() + $("#id_i_p_name").val());
		return false;
	} 
	$("#id_userName_").val(userName);
	
	var data;
	$.ajax({
		url: "/portal/pws?t=s_dp",
		type: "POST",
		cache: false,
		async: true,
		dataType: "text",
		data:$("#form1").serializeArray(),
		beforeSend: function() {
			i_p_f_pageLoading("start");
		},
		success: function(json){
	    	data = json;
	    },
		error: function(x,y,z) {
	    },
		complete: function() {
	    	i_p_f_pageLoading("complete");
			return f_afterSendDynamicPwd(data);
		}
	});
}

function f_afterSendDynamicPwd(data) {
	if (data==null || data=='') {
		alert($("#id_text_networkerror").val());
		return false;
	} else {
		var json = eval("("+i_p_f_base64DecodeAndUrlDecode(data)+")");  
		var v_errorNumber = json.errorNumber; 
        if (v_errorNumber != null && v_errorNumber == "1") {
        	$("#id_userDynamicPwdd").val(json.dynamicPwdd);
        	$("#id_userDynamicPwddd").val(json.dynamicPwddd);
        	imc_portal_function_setCookie("i_p_c_endTime", new Date().getTime() + ($("#id_intervalTime").val())*1000);
        	f_setSendDynamicPwdStatusWithCK(false);
        	alert($("#id_text_sendDynamicPwdSuc").val());
			return true;
        } else {
        	var v_errorInfo;
        	var v_errorCode = json[json.e_c];
        	var v_errorDescription = json[json.e_d];
        	if (v_errorCode!=null && v_errorDescription!=null) {
	        	v_errorInfo = $("#id_text_errormessage").val() + "(" + v_errorCode + ": " + v_errorDescription + ")";
        	} else if (v_errorDescription!=null) {
        		v_errorInfo = v_errorDescription;
        	} else {
        		v_errorInfo = $("#id_text_errormessage").val();
        	}
	  		alert(v_errorInfo);
        	return false;
        }
    }
}

</script>
    <script type="text/javascript">
	    jQuery(document).ready(function() {
	    	//如果界面有免责框的同意按钮，必须同意才可以上线
	    	if($("#lawArea").is(":visible")){
				$("#id_lable_loginbutton_auth").unbind().css("opacity","0.3");
	    		$("#lawAreaBox").bind("change",function(){
	    			var checked= $("#lawAreaBox").is(":checked");
	    	    	// 法律条款复选框
	    	    	if(checked){
	                   	$("#id_lable_loginbutton_auth").click(function(){
	                   		f_login();
	   			    	});
	                   	$("#id_lable_loginbutton_quickauth").click(function(){
	                   		f_login();
	   			    	});
	                   	$("#id_autoLogin_try").click(function(){
	                   		f_cpgAutoLogin();
	   			    	});
	                   	$("#id_lable_loginbutton_auth").css("opacity","1");
	    	    	} else {
	                    // 确定按钮的click事件取消
	       	    		$("#id_lable_loginbutton_auth").unbind().css("opacity","0.3");
	    	    	}
	    		});
			}else{
				//登录
				$("#id_lable_loginbutton_auth").click(f_login);
				$("#id_lable_loginbutton_quickauth").click(f_login);
				$("#id_autoLogin_try").click(f_cpgAutoLogin);
		    	// 回车上线事件
		        $(document).keydown(function(e){
				    var curKey = e.which;
				    if(curKey == 13){
				        f_login();
				    } 
				});
			}
	        // 按钮绑定事件
	        $("#id_lable_logoutbutton_auth").click(f_logout);
	        $("#id_lable_logoutbutton_quickauth").click(f_logout);
	        
			$("#id_getpwdbutton").click(f_showGetUserPwd);
			$("#id_getpwdcancelbutton").click(f_closeGetUserPwd);
			$("#id_changeImgLink").click(f_refreshValCodeTdContent);
			$("#id_getpwdokbutton").click(f_getUserPwd);
			$("#id_button_sendDynamicPwd").click(f_onSendDynamicPwd);
			
	        if($("#id_2dCodeImg").length > 0){
	    		f_qPortal();
	        };
	        if($("#autologin_confirm").length > 0){
	        	$("#autologin_confirm").unbind().css("opacity","0.3");
	    		$("#lawbox").bind("change",function(){
	    			var checked= $("#lawbox").is(":checked");
	    	    	// 法律条款复选框
	    	    	if(checked){
	                   	$("#autologin_confirm").click(function(){
	                   		//自动开户与认证
	                   		regAndLogin();
	                   		$("#autologin_confirm").unbind().css("opacity","0.3");
	   			    	});
	                   	$("#autologin_confirm").css("opacity","1");
	    	    	} else {
	                    // 确定按钮的click事件取消
	       	    		$("#autologin_confirm").unbind().css("opacity","0.3");
	    	    	}
	    		});
	        }
	    });
	</script>
  </head>
  
<body leftmargin="0" topmargin="0" class="ui-mobile-viewport">
<form id="form1" name="form1" method="post">
  <div id="pcContent" class="phone-content ui-overlay-f">
<div class="pc-edited-text pc-event-click ui-body-f ui-page ui-page-active pc-transparent" style="display: block; background-repeat: no-repeat; min-height: 953px;" data-role="page" data-pcrole="pc-role-phonepanel" data-theme="f" data-url="/portal/templatePage/20150106120255180/login_custom.jsp" tabindex="0">	<div class="pc-phone-content ui-content ui-page-footer-fixed" data-role="content" role="main">		<span class="page_title" id="id_title"></span>		<div class="pc-edited-text pc-event-click pc-phone-content-logo pc-event-dbclick" style="background-color: transparent;" data-pcrole="pc-role-phonelogopanel"><div align="left"><img src="iMC%20Portal_files/20160930181133_15.jpg"></div>		</div>		<div class="ui-corner-all ui-field-contain ui-body ui-br" style="border-width: 0px; padding: 0.5em 0px; margin-top: 5px;" data-role="fieldcontain" align="center"><p>				<span class="page_error" id="id_errorMessage" style="display: inline;">Portal authentication failed for the user is in authentication process. Please try later.</span>			</p><!--normalContentBegin--><div class="pc-edited-text pc-event-click" id="phone-login-panel" style="text-align: left;" data-pcrole="pc-role-ctrlallsubspanel">				<table style="border-width: 0px; width: 100%;">					<tbody>						<tr>							<td colspan="2">							<div style="position: relative;">							<input name="id_userName" class="ui-input-text ui-body-c ui-corner-all ui-shadow-inset ui-mini" id="id_userName" style="font-weight:normal;" placeholder="用户名" data-mini="true" data-theme="c" value="201435010122" type="text"> <input name="userName" id="id_userName_" value="201435010122" type="hidden">								</div>								</td>						</tr>						<tr>							<td colspan="2">							<div style="position: relative;">							<input name="id_userPwd" class="ui-input-text ui-body-c ui-corner-all ui-shadow-inset ui-mini" id="id_userPwd" style="font-weight:normal;" placeholder="密   码" value="" data-mini="true" data-theme="c" type="password"> <input name="userPwd" id="id_userPwd_" value="TUFObG9uZzAxODI=" type="hidden">								</div></td>						</tr>						<tr id="serviceTypeTR" style="display: none;">							<td colspan="2"><div class="ui-select"><a href="#" role="button" id="id_serviceTypeHIDE-button" aria-haspopup="true" aria-owns="id_serviceTypeHIDE-menu" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-icon="arrow-d" data-iconpos="right" data-theme="c" data-mini="true" class="ui-btn ui-btn-up-c ui-shadow ui-btn-corner-all ui-mini ui-btn-icon-right"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text"><span>服务类型</span></span><span class="ui-icon ui-icon-arrow-d ui-icon-shadow">&nbsp;</span></span></a><select name="serviceTypeHIDE" class="" id="id_serviceTypeHIDE" style="font-weight: normal; display: block;" size="1" data-mini="true" data-native-menu="false" data-theme="c" tabindex="-1">									<option value="" data-placeholder="true" selected="selected">服务类型</option>									<option value="">&nbsp;</option>							</select><div style="display: none;"><!-- placeholder --></div></div><input name="serviceType" id="id_serviceType" class="ui-input-text ui-body-f ui-corner-all ui-shadow-inset"></td>						</tr>						<tr>							<td colspan="2"><input name="isSavePwd" id="id_isSavePwd" style="margin-left: 2px;" data-role="none" checked="checked" type="checkbox">								<label class="pc-edited-text pc-event-dbclick" id="id_des_savepwd" style="width: 80%; font-size: 14px; margin-top: 5px; display: inline-block;" for="id_isSavePwd" data-pcrole="pc-role-phoneedittext">保存密码</label>							</td>						</tr>					</tbody>				</table>			</div><div class="pc-edited-text" id="phone-login-button-panel" style="border-width: 0px; padding: 0.5em 0px;">				<div class="ui-grid-a" style="padding: 1px 0px;">					<div class="ui-block-a">						<a name="login" class="ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-up-f ui-corner-all ui-btn-up-undefined" id="id_lable_loginbutton_auth" data-role="none" data-mini="true" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span"><span class="pc-edited-text pc-event-click pc-event-dbclick ui-btn-inner ui-btn-corner-all" data-pcrole="pc-role-phonebtn">上线</span></a>					</div>					<div class="ui-block-b">						<a name="logout" class="ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-up-f ui-corner-all" id="id_lable_logoutbutton_auth" data-role="none" data-mini="true" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span">							<span class="pc-edited-text pc-event-click pc-event-dbclick ui-btn-inner ui-btn-corner-all" data-pcrole="pc-role-phonebtn">下线</span>						</a>					</div>				</div>			</div><!--normalContentEnd=guestContentBegin--><div id="id_quickAuthPanel" style="display: none;">				<label class="ui-input-text" id="id_des_quickAuth"></label>				<div class="ui-grid-a" style="padding: 1px 0px;">					<div class="ui-block-a">					<a name="login" class="ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-up-f ui-corner-all" id="id_lable_loginbutton_quickauth" data-role="button" data-pcrole="pc-role-phonebtn" data-inline="true" data-pcsync="pc-sync-btn"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">						    上线					</span></span></a> 					</div>					<div class="ui-block-b">					<a name="logout" class="ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-up-f ui-corner-all" id="id_lable_logoutbutton_quickauth" data-role="button" data-pcrole="pc-role-phonebtn" data-inline="true" data-pcsync="pc-sync-btn"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">						    下线					</span></span></a>				</div>			</div>		</div><div class="pc-edited-text pc-event-click page_copyright ui-input-text pc-event-dbclick" id="id_a_applyguest_custom_div" style="width: 100%; font-size: 0.9em; margin-top: 5px; display: none; position: relative; z-index: 1;" data-pcrole="pc-role-phoneedittextcandel" align="right">                <a class="pc-edited-text ui-link ui-corner-all" id="id_a_applyguest_custom" onclick="return false;" href="" target="_blank">访客预注册</a>            </div><div class="pc-edited-text pc-event-click ui-corner-all  ui-field-contain ui-body pc-event-dbclick ui-br" style="border: 1px solid rgb(238, 238, 238); border-image: none; text-align: left; font-size: 12px; margin-top: 1em; position: relative !important;" data-role="fieldcontain" data-pcrole="pc-role-phoneedittextcandel" align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;校内师生请登录个人门户开通无线上网帐号，为了您的帐号安全，请不要随意透露您的帐号及密码信息。</div></div>	<div class="pc-edited-text pc-event-click page_copyright ui-footer ui-bar-f slideup ui-footer-fixed pc-event-dbclick" id="id_copyright" style="text-align: center; font-size: 12px; font-weight: normal;" data-role="footer" data-pcrole="pc-role-phoneedittextcandel" data-theme="f" role="contentinfo"><p>校园信息化建设与管理办公室</p><p>服务电话：88821520</p></div>		<!-- 	<table style="display: none;"> --><!-- 		<tr id="serviceTypeTR2"> --><!-- 			<td colspan="3"><select data-mini="true" data-native-menu="false" id="id_serviceType2" --><!-- 				class="page_input ui-btn-corner-all pc-phone-select" --><!-- 				style="width: 100%; background: none repeat scroll 0px 0px rgb(238, 238, 238); text-shadow: 0px 1px 0px rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204); height: 28px; line-height: 28px; font-size: 14px; padding: 5px; text-align: left;" --><!-- 				size="1" name="serviceType2"> --><!-- 					<option data-placeholder="true">服务类型</option> --><!-- 					<option value="">&nbsp;</option> --><!-- 			</select> --><!-- 			</td> --><!-- 		</tr> --><!-- 		<tr id="serviceTypeTR3"> --><!-- 			<td> --><!--               <input id='id_serviceType3' name='serviceType3' value='default'/> --><!-- 			</td> --><!-- 		</tr> --><!-- 	</table> -->		</div><div class="ui-screen-hidden ui-popup-screen"></div><div class="ui-popup-container ui-selectmenu-hidden"><div class="ui-selectmenu ui-popup ui-body-a ui-overlay-shadow ui-corner-all" aria-disabled="false" data-disabled="false" data-theme="a" data-shadow="true" data-corners="true" data-transition="none" data-position-to="origin"><div class="ui-header ui-bar-c"><h1 class="ui-title">服务类型</h1></div><ul class="ui-selectmenu-list ui-listview" id="id_serviceTypeHIDE-menu" role="listbox" aria-labelledby="id_serviceTypeHIDE-button" data-theme="c"><li data-option-index="0" data-icon="false" data-placeholder="true" class="ui-selectmenu-placeholder ui-btn ui-btn-up-c ui-btn-icon-right ui-li" role="option" data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="div" data-iconpos="right" data-theme="c" aria-selected="false"><div class="ui-btn-inner ui-li"><div class="ui-btn-text"><a href="#" tabindex="-1" class="ui-link-inherit">服务类型</a></div></div></li><li data-option-index="1" data-icon="false" class="ui-btn ui-btn-up-c ui-btn-icon-right ui-li ui-li-last" role="option" data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="div" data-iconpos="right" data-theme="c" aria-selected="false"><div class="ui-btn-inner ui-li"><div class="ui-btn-text"><a href="#" tabindex="-1" class="ui-link-inherit">&nbsp;</a></div></div></li></ul></div></div></div>
<script> var pageSetting = {"ctrlType":"portalphone","pageType":"login","screenWidth":"540","screenHeight":"500","previewWinWidth":"540","previewWinHeight":"500"}</script>  <div class="ui-loader ui-corner-all ui-body-a ui-loader-default"><span class="ui-icon ui-icon-loading"></span><h1>loading</h1></div></div>
  <p style="display:none;">
	
  </p>
  












<input id="userGroupId" value="" type="hidden">
<input id="guestManagerId" value="" type="hidden">
<input id="regCode" value="" type="hidden"> 
<input id="regCodeType" value="0" type="hidden">                   
<script language="JavaScript">
        
        function imc_portal_function_getServiceTypeOptions() {
	        var imc_portal_var_service_type_options = new Array();

			return imc_portal_var_service_type_options;
        }
        
        
        function imc_portal_function_getStrForInner() {
			return 'null';
        }
        
        
        function imc_portal_function_getStrForOuter() {
 			return 'null';
        }

		
    	function imc_portal_function_ifQuickAuth() {
			return false;
        }

    	
        function imc_portal_function_ifTryUsePopupWindow() {
			return false;
        }

    	
        function imc_portal_function_getLanguage() {
			return 'English';
        }

        
        var v_valCodeType = '0';
        function i_p_f_valCodeType() {
       		return v_valCodeType;
        }

        
        function imc_portal_function_ifEnablePortalEntrance() {
			return false;
        }

        
        function imc_portal_function_ifShowOnlyPortalAuth() {
			return false;
        }

        
        function imc_portal_function_ifOnlyPortalAuth() {
			return false;
        }

        
        function imc_portal_function_uamInitCustom() {
            return 1;
        }
		
        function imc_portal_function_getCustomCfg() {
            return 'MTAw';
        }
        
        function imc_portal_function_uamInitLogo() {
            return 'H3C';
        }

        
        function imc_portal_function_readByodServerAddress() {
            return '10.62.64.122';
        }
        
        
        function imc_portal_function_readByodServerAddressIPv6() {
            return '0000:0000:0000:0000:0000:0000:0000:0000';
        }
        
        
        function imc_portal_function_readByodServerHttpPort() {
            return '80';
        }
        
        
        function imc_portal_function_getClientIP() {
            return '10.63.71.58';
        }
        
        
        function imc_portal_function_getClientIPVersion() {
        	
            return 4;
        }

</script>
    

<input name="userurl" value="" type="hidden">
<input name="userip" value="" type="hidden">
<input name="basip" value="" type="hidden">						                
<input name="language" value="English" type="hidden">
<input name="usermac" value="null" type="hidden">
<input name="wlannasid" value="" type="hidden">
<input name="wlanssid" value="" type="hidden">
<input name="entrance" value="null" id="id_entrance" type="hidden">
<input name="loginVerifyCode" value="" id="id_loginVerifyCode" type="hidden">
<input name="userDynamicPwddd" value="" id="id_userDynamicPwddd" type="hidden">
<input value="false" id="id_ifMustGetPasswordBeforeLogin" type="hidden">
<input name="customPageId" value="100" id="id_customPageId" type="hidden">


<input name="pwdMode" value="0" id="id_pwdMode" type="hidden">



<input name="portalProxyIP" value="10.62.64.115" type="hidden">
<input name="portalProxyPort" value="50200" type="hidden">
<input name="dcPwdNeedEncrypt" value="1" type="hidden">
<input name="assignIpType" value="0" type="hidden">
<input name="appRootUrl" value="http://10.62.64.115/portal/" type="hidden">
<input name="manualUrl" value="" type="hidden"> 
<input name="manualUrlEncryptKey" value="" type="hidden">
<input id="id_intervalTime" value="60" type="hidden">




<input id="id_findPwdUrl" value="http://10.62.64.122:8080/selfservice/mail/forgetPassword.jsf?init=true&amp;url=aHR0cDovLzEwLjYyLjY0LjExNS9wb3J0YWwvdGVtcGxhdGVQYWdlLzIwMTUwMTA2MTIwMjU1MTgwL2xvZ2luX2N1c3RvbS5qc3A" type="hidden">






<input id="id_i_p_info_mbNumber" value="Account" type="hidden">
<input id="id_i_p_name" value="用户名" type="hidden">
<input id="id_i_p_passwd" value="密   码" type="hidden">
<input id="id_i_p_dynamicPwd" value="Dynamic Password" type="hidden">
<input id="id_i_p_info_getPwd" value="Get Password" type="hidden">
<input id="id_i_p_info_clickGetPwd" value="Get Password" type="hidden">
<input id="id_i_p_info_ok" value="Get" type="hidden">
<input id="id_i_p_info_cancel" value="Cancel" type="hidden">
<input id="id_i_p_info_vCode" value="" type="hidden">
<input id="id_i_p_info_verifyCode" value="Verify Code" type="hidden">
<input id="id_i_p_info_valLicCode" value="License Code" type="hidden">
<input id="id_i_p_info_valCodeRenew" value="Refresh Image" type="hidden">
<input id="id_i_p_info_getPwdSuccInfo" value="Your password has been sent to your mobile phone. Please check the SMS message." type="hidden">
<input id="id_i_p_info_2dCode" value="Use a QR code scanner to obtain the login name and password." type="hidden">
<input id="id_i_p_needEnter" value="Please enter " type="hidden">
<input id="id_i_p_namelimit" value=" cannot contain the following characters: #+/?%&amp;=*'@\&quot;[]()&lt;&gt;`, tab, and continuous spaces." type="hidden">
<input id="id_i_p_info_waitMsg" value="Time Left" type="hidden">
<input id="id_i_p_info_waitMsg_unit_min" value="Sec" type="hidden">
<input id="id_i_p_portalOnly" value="Portal authentication only" type="hidden">
<input id="id_des_logoutsucc" value="Logged out successfully." type="hidden">
<input id="id_des_logoutfailed" value="Failed to log out." type="hidden">
<input id="id_text_Top_Description_title" value="Welcome to iMC Portal" type="hidden">
<input id="id_text_servicetype" value="Service Type" type="hidden">
<input id="id_text_isSavepwd" value="Remember Password" type="hidden">
<input id="id_text_login_inside" value="Access Intranet" type="hidden">
<input id="id_text_login_outside" value="Access Internet" type="hidden">
<input id="id_text_ClickToServe" value="Click Log In to access the network." type="hidden">
<input id="id_text_login" value="Log In" type="hidden">
<input id="id_text_login_zh" value="上线" type="hidden">
<input id="id_text_login_en" value="Log In" type="hidden">
<input id="id_text_logout" value="Log Out" type="hidden">
<input id="id_text_faq" value="Frequently asked questions" type="hidden">
<input id="id_text_getBackPwd" value="Forget password" type="hidden">
<input id="id_text_request_uam_guest" value="Register Guest" type="hidden">
<input id="id_text_jre" value="Download and Install JRE" type="hidden">
<input id="id_text_onlinehelp" value="View Online Help" type="hidden">
<input id="id_text_chmhelp" value="Download CHM Help File" type="hidden">
<input id="id_text_pdfhelp" value="Download PDF Help File" type="hidden">
<input id="id_text_vendor_H3C" value="Hangzhou H3C Technologies Co., Ltd." type="hidden">
<input id="id_text_vendor_HP" value="Hewlett-Packard Development Company, L.P." type="hidden">
<input id="id_text_homepage_H3C" value="http://www.h3c.com" type="hidden">
<input id="id_text_homepage_HP" value="http://www.hp.com" type="hidden">
<input id="id_text_Copyright_H3C" value="Copyright © 2007-2015 Hangzhou H3C Technologies Co., Ltd. All rights reserved." type="hidden">
<input id="id_text_Copyright_HP" value="Copyright © 2015 Hewlett-Packard Development Company, L.P. and its licensors." type="hidden">
<input id="id_text_nameisblank" value="Please enter your username." type="hidden">
<input id="id_text_nameformat" value="Wrong username format. Correct format: name, or name@suffix." type="hidden">
<input id="id_text_nameinvalid" value="The username is in the format of name or name@suffix. The name portion cannot contain consecutive spaces, the Tab character, and any of the following: {0}. The suffix portion can contain a single space, letters, numbers, underscores (_), hyphens (-), and dots (.), and cannot contain consecutive spaces." type="hidden">
<input id="id_text_nameinvalid_io" value="The username cannot contain tabs, consecutive spaces, or any of the following characters: {0}" type="hidden">
<input id="id_text_pwdisblank" value="Please enter your password." type="hidden">
<input id="id_text_cpg_loginerror" value="接入失败，请清空浏览器缓存后再试。" type="hidden">
<input id="id_text_cpg_tdCode_title" value="Scan QR Code for Formal Registration URL." type="hidden">
<input id="id_text_cpg_autoLogin_failed" value="Automatic login failed. Please click to try again." type="hidden">
<input id="id_text_networkerror" value="The network is error." type="hidden">
<input id="id_text_modifypwd" value="Modify Password" type="hidden">
<input id="id_text_autoRegAndLogin" value="Guest auto-registration fails.Please try again later, or contact the administrator." type="hidden">
<input id="id_text_errormessage" value="Sorry, an error has occurred. Please contact the administrator." type="hidden">
<input id="id_text_sendDynamicPwdSuc" value="The password has been sent to your mobile phone." type="hidden">
<input id="id_text_needGetDynaPwd" value="Invalid password. Please enter the dynamic password that has been sent to your mobile phone." type="hidden">
<input id="id_text_needGetUserPassword" value="Click Get Password and use the new password for login." type="hidden">





</form>
<script src="iMC%20Portal_files/jquery_002.js"></script>


<div id="id_loading" style="display: none;"><div id="id_loading_filter" class="loading_filter"></div></div><div class="pc-copyright"><img style="border: medium none;" src="iMC%20Portal_files/licencelogo.gif"></div></body></html>